#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Dialog Base Class
 *		Provides the base implementation for all AI-application dialogs.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"

using namespace System;
using namespace System::Drawing;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;

namespace Adaptive
{
	namespace Foundation
	{
		namespace Windows
		{
			namespace Forms
			{
				/// <summary>
				/// Provides the base implementation for all application dialogs.
				/// </summary>
				/// <remarks>
				/// This is the base template for all dialogs within the application.
				/// </remarks>
				public ref class DialogBase : public Form
				{
				public:
					/*--------------------------------------------------------------------------------
					 * Constructor / Dispose / Destructor Methods
					 *------------------------------------------------------------------------------*/
					#pragma region Constructor / Dispose / Destructor Methods
					/// <summary>
					/// Initializes a new instance of the class.
					/// </summary>
					/// <value>
					/// This is the default constructor.
					/// </value>
					DialogBase();
					/// <summary>
					/// Deallocates internally allocated objects.
					/// </summary>
					~DialogBase();
					/// <summary>
					/// Deallocates internally allocated objects.
					/// </summary>
					!DialogBase();
					#pragma endregion

				protected:
					/*--------------------------------------------------------------------------------
					 * Protected Methods / Functions
					 *------------------------------------------------------------------------------*/
					#pragma region Protected Methods / Functions
			        /// <summary>
					/// Raises the <see cref="Form::Load"/> event.
					/// </summary>
					/// <param name="e">
					/// An <see cref="EventArgs"/> event arguments instance.
					/// </param>
					virtual void OnLoad(EventArgs^ e) override;
					/// <summary>
					/// Raises the <see cref="OnClosing"/> event.
					/// </summary>
					/// <param name="e">
					/// A <see cref="CancelEventArgs"/> event arguments instance.
					/// </param>
					virtual void OnClosing(CancelEventArgs^ e) override;
					/// <summary>
					/// Creates and assigns event handlers for the events of the form's controls.
					/// </summary>
					virtual void AssignEventHandlers();
					/// <summary>
					/// Removes the event handler assignments for the events of the form's controls.
					/// </summary>
					virtual void RemoveEventHandlers();
					/// <summary>
					/// Sets the initial dialog data content.
					/// </summary>
					virtual void SetInitialContent();
					/// <summary>
					/// Sets or resets the display state of the dialog.
					/// </summary>
					virtual void SetFormDisplay();
					/// <summary>
					/// Laucnhes any background threads for the dialog.
					/// </summary>
					virtual void StartFormThreads();
					/// <summary>
					/// Terminates execution of any background form threads.
					/// </summary>
					virtual void TerminateFormThreads();
					#pragma endregion

					/*--------------------------------------------------------------------------------
					 * Protected Member Declarations
					 *------------------------------------------------------------------------------*/
					#pragma region Protected Member Declarations
					/// <summary>
					/// Required designer variable.
					/// </summary>
					System::ComponentModel::IContainer^ components;
					#pragma endregion

				private:
					/*--------------------------------------------------------------------------------
					 * Private Member Declarations
					 *------------------------------------------------------------------------------*/
					#pragma region Private Member Declarations
					#pragma endregion

					/// <summary>
					/// Required method for Designer support - do not modify
					/// the contents of this method with the code editor.
					/// </summary>
					void InitializeComponent();

				};
			}
		}
	}
}
